package cn.jsl.downgrade;

import cn.jsl.entity.User;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 服务降级类
 */
public class DowngradeUtil {

    /**
     * @Description: 服务降级方法
     * @param ex: 服务降级方法必须接收的异常参数
     * 必须是静态的所以要加static
     **/
    public static User getUserByIdBlockHandler(@PathVariable("id") Long id, BlockException ex){
        ex.printStackTrace();
        return new User(-1L,"赟一","赟一被灏猪拱了");
    }
}
